export default{
    Date2Str(date){
        let year=date.getFullYear(); //获取完整的年份(4位,1970-????)
        let moonth=date.getMonth(); //获取当前月份(0-11,0代表1月)
        let day=date.getDate(); //获取当前日(1-31)
        let hour=date.getHours(); //获取当前小时数(0-23)
        let minute=date.getMinutes(); //获取当前分钟数(0-59)
        let second=date.getSeconds(); //获取当前秒数(0-59)
        // let milSecond=date.getMilliseconds(); //获取当前毫秒数(0-999) 
        return `${year}-${moonth}-${day} ${hour}:${minute}:${second}`;
    },

    Date2StrShort(date){
        let year=date.getFullYear(); //获取完整的年份(4位,1970-????)
        let moonth=date.getMonth(); //获取当前月份(0-11,0代表1月)
        let day=date.getDate(); //获取当前日(1-31)
        let hour=date.getHours(); //获取当前小时数(0-23)
        let minute=date.getMinutes(); //获取当前分钟数(0-59)
        let second=date.getSeconds(); //获取当前秒数(0-59)
        // let milSecond=date.getMilliseconds(); //获取当前毫秒数(0-999) 
        return `${year}-${moonth}-${day}`;
    },

    Date2Unix(date){
        return date.getTime();//获取当前时间(从1970.1.1开始的毫秒数)
    }
}